package com.bdzl.pojo;

import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * Illness entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "illness", catalog = "bdzl")
public class Illness  {

	// Fields

	private Integer id;
	private Clause clause;//条款ID
	private Integer waitDay;//等待期(90天)
	private String exemption;//豁免内容（例如：身故豁免，重疾豁免。直接填汉字）
	private String share;//轻症与重症是否共享保额  可以为空
	private String lights;//（所有的轻疾病ID，区分
	private String heavys;//（所有的重疾病ID，区分）
	private String givens;//（所有的特定疾病ID，区分）
	private Set<IllnessInformation> illnessInformations = new HashSet<IllnessInformation>(
			0);

	// Constructors

	/** default constructor */
	public Illness() {
	}

	/** full constructor */
	public Illness(Clause clause, Integer waitDay, String exemption,
			String share, String lights, String heavys, String givens,
			Set<IllnessInformation> illnessInformations) {
		this.clause = clause;
		this.waitDay = waitDay;
		this.exemption = exemption;
		this.share = share;
		this.lights = lights;
		this.heavys = heavys;
		this.givens = givens;
		this.illnessInformations = illnessInformations;
	}

	// Property accessors
	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "id", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "clause_id")
	public Clause getClause() {
		return this.clause;
	}

	public void setClause(Clause clause) {
		this.clause = clause;
	}

	@Column(name = "wait_day")
	public Integer getWaitDay() {
		return this.waitDay;
	}

	public void setWaitDay(Integer waitDay) {
		this.waitDay = waitDay;
	}

	@Column(name = "exemption")
	public String getExemption() {
		return this.exemption;
	}

	public void setExemption(String exemption) {
		this.exemption = exemption;
	}

	@Column(name = "share")
	public String getShare() {
		return this.share;
	}

	public void setShare(String share) {
		this.share = share;
	}

	@Column(name = "lights")
	public String getLights() {
		return this.lights;
	}

	public void setLights(String lights) {
		this.lights = lights;
	}

	@Column(name = "heavys")
	public String getHeavys() {
		return this.heavys;
	}

	public void setHeavys(String heavys) {
		this.heavys = heavys;
	}

	@Column(name = "givens")
	public String getGivens() {
		return this.givens;
	}

	public void setGivens(String givens) {
		this.givens = givens;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "illness")
	public Set<IllnessInformation> getIllnessInformations() {
		return this.illnessInformations;
	}

	public void setIllnessInformations(
			Set<IllnessInformation> illnessInformations) {
		this.illnessInformations = illnessInformations;
	}

}